package com.zdkj.admin.api.feign;

import com.zdkj.admin.api.entity.SwPmDeviceOperationCodeRecord;
import com.zdkj.admin.api.entity.SwPmStationPersonGuard;
import com.zdkj.common.core.constant.SecurityConstants;
import com.zdkj.common.core.constant.ServiceNameConstants;
import com.zdkj.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @support: zdkj
 * @author: cuilei
 * @version: 1.0
 * @Date: 2020-05-11 17:10
 * @Description: <p>
 * 辅助模块服务调用
 * </p>
 */
@FeignClient(contextId = "remoteSupportService", value = ServiceNameConstants.SUPPORT_SERVICE)
public interface RemoteSupportService {
    /**
     * 车站人员在岗信息初始化
     * @param swPmStationPersonGuard
     * @return
     */
    @PostMapping("/swpmstationpersonguard/inner")
    R stationPersonGuardSave(@RequestBody SwPmStationPersonGuard swPmStationPersonGuard, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过code查询线路名称
     * @param code
     * @return
     */
    @GetMapping("/swparamline/name/byCode/{code}")
    R<String> getLineNameByCode(@PathVariable("code") String code);
	    /**
     * 通过线路lineCode和站点code查询线路和站点名称
     * @param code
     * @return
     */
    @GetMapping("/swparamline/name/byLineCodeAndCode/{lineCode}/{code}")
    R<String> getLnameAndSnameByCode(@PathVariable("lineCode") String lineCode, @PathVariable(value = "code") String code);

    /**
     * 通过code查询车站设置表
     *
     * @param code code
     * @return R
     */
    @GetMapping("/swparamstation/byCode/{code}")
    R getStationByCode(@PathVariable("code") String code);

    /**
     * 通过name查询线路code
     * @param name
     * @return
     */
    @GetMapping("/swparamline/name/byName/{name}")
    R<String> getCodeByName(@PathVariable("name") String name);

    /**
     * 通过name和lineCode查询车站code
     * @param name
     * @param lineCode
     * @return
     */
    @GetMapping("/swparamstation/name/byNameAndLineCode/{name}/{lineCode}")
    R<String> getCodeByNameAndLineCode(@PathVariable("name")String name, @PathVariable("lineCode")String lineCode);

    /**
     * insertOrUpdate设备操作表
     * @param lineCode
     * @param stationCode
     * @param operationCode
     * @return
     */
    @GetMapping("/swpmdeviceoperationcode/insertDeviceOperation/{lineCode}/{stationCode}/{operationCode}")
    R insertDeviceOperation(@PathVariable("lineCode")String lineCode, @PathVariable("stationCode")String stationCode, @PathVariable("operationCode")String operationCode);

    /**
     * 非导入方式记录到设备操作号历史使用记录表
     * @param swPmStationPersonGuard
     * @return
     */
    @PostMapping("/swpmdeviceoperationcoderecord/innerSave")
    R swPmDeviceOperationCodeRecordSave(@RequestBody SwPmDeviceOperationCodeRecord swPmStationPersonGuard, @RequestHeader(SecurityConstants.FROM) String from);
}
